# 导入pygame模块
import pygame

# 初始化pygame
pygame.init()

# 设置窗口大小
screen_width = 640
screen_height = 480
screen = pygame.display.set_mode((screen_width, screen_height))

# 游戏主循环
running = True
while running:
    # 处理事件
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    # 更新游戏逻辑 (如角色移动)
    # ...

    # 绘制屏幕
    # ...

    # 更新显示
    pygame.display.flip()

# 结束游戏
pygame.quit()